package com.company.map;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * @ProjectName: 复习java
 * @Package: com.company.map
 * @ClassName: testMap
 * @Author: wym
 * @Date: 2020/8/27 9:57
 * @Version: 1.0
 */
public class testMap {
    public static void main(String[] args) {
        Map<Integer,String> map=new HashMap<>(16);
        map.put(1,"aaaa");
        map.put(2,"2222");
        map.put(3,"3333");
        System.out.println(map);
        Set<Map.Entry<Integer, String>> entries = map.entrySet();
        Iterator<Map.Entry<Integer, String>> iterator = entries.iterator();
//        while (iterator.hasNext()){
//            Map.Entry<Integer, String> next = iterator.next();
//            System.out.println(next.getKey());
//            System.out.println(next.getValue());
//        }

//                for (Map.Entry<Integer, String> entrie:entries) {
//            System.out.println(entrie.getKey());
//                    System.out.println(entrie.getValue());
        }

    }

